package com.cetc.sdp.kmga.cs.stream;

import com.cetc.sdp.kmga.cs.audit.*;
import com.cetc.sdp.kmga.cs.common.*;
import com.cetc.sdp.kmga.cs.schema.*;
import com.cetc.sdp.kmga.cs.schema.v2.*;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.serializers.FieldSerializer;
import org.apache.spark.serializer.KryoRegistrator;

/**
 * @description:
 * @author： DengQiang
 * @date: 2017/10/10 14:58
 */
public class EventKryoRegistrator implements KryoRegistrator {

    @Override
    public void registerClasses(Kryo kryo) {
        kryo.register(AuditRule.class, new FieldSerializer(kryo, AuditRule.class));
        kryo.register(AuditRuleCondition.class, new FieldSerializer(kryo, AuditRuleCondition.class));
        kryo.register(AuditRuleFastMatcher.class, new FieldSerializer(kryo, AuditRuleFastMatcher.class));
        kryo.register(IPSet.class, new FieldSerializer(kryo, IPSet.class));
        kryo.register(IPSet.IpSeg.class, new FieldSerializer(kryo, IPSet.IpSeg.class));
        kryo.register(ResourceAuditObj.class, new FieldSerializer(kryo, ResourceAuditObj.class));
        kryo.register(ResourceKey.class, new FieldSerializer(kryo, ResourceKey.class));
        kryo.register(HbaseRecord.class, new FieldSerializer(kryo, HbaseRecord.class));
        kryo.register(KafkaLog.class, new FieldSerializer(kryo, KafkaLog.class));
        kryo.register(TableMapping.class, new FieldSerializer(kryo, TableMapping.class));
        kryo.register(SchemaDesc.class, new FieldSerializer(kryo, SchemaDesc.class));
        kryo.register(OpCode.class, new FieldSerializer(kryo, OpCode.class));
        kryo.register(IndexSchemaDesc.class, new FieldSerializer(kryo, IndexSchemaDesc.class));
        kryo.register(AuditDbSchemaDescV2.class, new FieldSerializer(kryo, AuditDbSchemaDescV2.class));
        kryo.register(AuditDbSchemaDescV2.AuditDbLog.class, new FieldSerializer(kryo, AuditDbSchemaDescV2.AuditDbLog.class));
        kryo.register(AuditDbSchemaDescV2.LogFieldIndex.class, new FieldSerializer(kryo, AuditDbSchemaDescV2.LogFieldIndex.class));
        kryo.register(AuditOpSchemaDescV2.class, new FieldSerializer(kryo, AuditOpSchemaDescV2.class));
        kryo.register(DesensSchemaDescV2.class, new FieldSerializer(kryo, DesensSchemaDescV2.class));
        kryo.register(DesensOpSchemaDescV2.class, new FieldSerializer(kryo, DesensOpSchemaDescV2.class));
        kryo.register(OpsSchemaDescV2.class, new FieldSerializer(kryo, OpsSchemaDescV2.class));
        kryo.register(SuperviseOpSchemaDescV2.class, new FieldSerializer(kryo, SuperviseOpSchemaDescV2.class));
        kryo.register(IndexTable.class, new FieldSerializer(kryo, IndexTable.class));
        kryo.register(AuditStream.TableNameCache.class, new FieldSerializer(kryo, AuditStream.TableNameCache.class));
        kryo.register(AuditStream.IndexTableId.class, new FieldSerializer(kryo, AuditStream.IndexTableId.class));
    }
}
